package cn.wk.basic.config;

import cn.wk.basic.interceptor.LoginInfoInterceptor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Configuration
public class LoginInfoWebMvcConfigurer implements WebMvcConfigurer {
    @Autowired
    private LoginInfoInterceptor loginInfoInterceptor;

    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(loginInfoInterceptor).addPathPatterns("/**")
                .excludePathPatterns("/login").excludePathPatterns("/shop/**")
                .excludePathPatterns("/fastdfs/**")
                .excludePathPatterns("/pay/returnUrl")
                .excludePathPatterns("/pay/notifyUrl")
                .excludePathPatterns("/verification/**")
                .excludePathPatterns("/wechat/**")
                .excludePathPatterns("/user/**")
                .excludePathPatterns("/product/**");
    }


}
